package com.xiaoyg;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author xiaoyg
 * @Title: Consumer
 * @ProjectName spring-rabbitmq
 * @Description: TODO
 * @date 2018/12/516:50
 */
public class Consumer {


    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        AmqpTemplate amqpTemplate = applicationContext.getBean(RabbitTemplate.class);

        System.out.println("Receive: " + amqpTemplate.receiveAndConvert());
    }

}
